package org.elephas.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.elephas.persistence.audit.DateCreated;
import org.elephas.persistence.audit.DateUpdated;
import org.hibernate.annotations.GenericGenerator;

/**
 * <p>
 * User: Nick Heudecker
 * </p>
 * <p>
 * Date: Jan 27, 2008
 * </p>
 * <p>
 * Time: 5:35:03 PM
 * </p>
 */
@MappedSuperclass
public abstract class AbstractPersistent {

	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	private String uuid;

	@DateCreated
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false)
	private Date created;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = false)
	@DateUpdated
	private Date updated;

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public Date getCreated() {
		return created;
	}

	public Date getUpdated() {
		return updated;
	}
}
